﻿using Abp.Application.Services;
using Microsoft.AspNetCore.Mvc;
using SportsPlatform.Application.Dto.SportBusiness.CompetitionProjec;
using SportsPlatform.Application.Query.CompetitionProjec;
using SportsPlatform.Base;
using SportsPlatform.Dto.SportBusiness.CompetitionProjec;
using SportsPlatform.Query.CompetitionProjec;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SportsPlatform.SportBusiness.ISportBusiness
{
    /// <summary>
    /// 赛事项目相关接口
    /// </summary>
    public interface ICompetitionProjectService : IApplicationService
    {
        /// <summary>
        /// 获取赛事比赛项目列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<PagePagingDto<GetCompetitionProjecListDto>> GetCompetitionProjecList(GetCompetitionProjecListQuery query);

        /// <summary>
        /// 根据赛事ID获取当前赛事状态为正在报名到比赛结束之前的赛事项目列表
        /// 用于添加报名时根据赛事ID获取
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ResultListDto<GetComProjectListByComIdDto>> GetComProjectListByComId(GetComProjectListByComIdQuery query);

        /// <summary>
        /// 获取当前比赛项目
        /// </summary>
        /// <returns></returns>
        Task<ResultListDto<GetCurrentCompetitionProjectListDto>> GetCurrentCompetitionProjectList();

        /// <summary>
        /// 新增、修改赛事比赛项目
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> EditCompetitionProjec(EditCompetitionProjecQuery query);

        /// <summary>
        /// 结束报名
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> EndSignUp(CompetitionProjectIdQuery query);


        /// <summary>
        /// 结束赛事项目
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> EndCompetitionProject(CompetitionProjectIdQuery query);

        /// <summary>
        /// 启用比赛项目
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> EnableCompetitionProject(CompetitionProjectIdQuery query); 

        /// <summary>
        /// 关闭比赛项目
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> CloseCompetitionProject(CompetitionProjectIdQuery query);

        /// <summary>
        /// 根据比赛项目Id获取比赛项目详情
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ResultDto<GetCompetitionPorjectDetailsDto>> GetCompetitionPorjectDetailsById(CompetitionProjectIdQuery query);

        /// <summary>
        /// 获取比赛规则
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ResultListDto<GetRuleListDto>> GetRuleList(GetRuleListQuery query);

        /// <summary>
        /// 获取比赛分组报名人员列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ResultListDto<GetGroupListDto>> GetGroupList(GetGroupListQuery query);



        /// <summary>
        /// 根据赛事项目ID获取最大报名人数限制和是否达到最大报名人数限制
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ResultDto<GetMaxEmployeeNumDto>> GetMaxEmployeeNum([FromBody] GetMaxEmployeeNumQuery query);

        /// <summary>
        /// 客户端分页获取赛事项目信息（用于信息同步）
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<PagePagingDto<GetPageCompetitionPorjectKHDDto>> GetPageCompetitionPorjectKHD(BasePageQuery query);

        /// <summary>
        /// 客户端赛事项目信息同步
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<BaseResultDto> CompetitionPorjectSynchronization(List<CompetitionPorjectSynchronizationQuery> query);
    }
}
